<?php
/**
 * regd by PhpStorm.
 * User: lee
 * Date: 2017/11/29
 * Time: 17:31
 */

namespace Biz\validate;

use Biz\validate\ShopCompanyInfo as vShopCompanyInfo;


class ShopPersonalInfo extends \Doraemon\pockets\validate\Base
{


    public static function rules()
    {
        return [
            ['realname', 'required', null, '请填写姓名', ['signup']],
            ['realname', 'length', '2,10', '请正确填写姓名', ['signup', 'update']],
            ['realname', 'regex', ['pattern' => '/^[\x{4e00}-\x{9fa5}_\-a-zA-Z0-9]+$/u'], '请正确填写姓名', ['signup', 'update']],


            ['id_number', 'required', null, '请填写身份证号', ['signup']],

            ['id_number', 'callback', ['callback' => [new vShopCompanyInfo(), 'checkIdCard']], '请正确填写身份证号码', ['signup', 'update']],

        ];

    }

}